﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace IMIS_ERP.Web.Head_Shop
{
    public partial class Search : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Bind_SID();
            }
        }

        /// <summary>绑定加盟店ID
        ///     <remarks>2010-12-10 河大信管团队</remarks>
        /// </summary>
        private void Bind_SID()
        {
            IMIS_ERP.BLL.Shop_Info bll = new BLL.Shop_Info();
            SqlDataReader dr = bll.GetList();
            ddlSID.DataSource = dr;
            ddlSID.DataTextField = "siID";
            ddlSID.DataBind();
            dr.Close();
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            IMIS_ERP.BLL.Head_Shop bll = new IMIS_ERP.BLL.Head_Shop();
            SqlDataReader dr=bll.GetSiSum(ddlSID.SelectedValue,txthTime1.Text.Trim(),txthTime2.Text.Trim());
            GV.DataSource = dr;
            GV.DataBind();
            dr.Close();
        }

        /// <summary>响应GridView事件：创建数据行时
        /// 	<remark>2010-12-08 BY 河北大学信管团队</remark>
        /// </summary>
        protected void GV_RowCreated(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //为数据行增加鼠标移动到行特性
                e.Row.Attributes.Add("onmouseover", "c=style.backgroundColor;this.style.backgroundColor='" + IMIS_ERP.BLL.Assistant.getColor1 + "'");
                //为数据行增加鼠标离开行特性
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
            }
        }
    }
}